package com.selfdriving.activity;

import net.tsz.afinal.annotation.view.ViewInject;
import com.selfdriving.R;
import com.selfdriving.dialog.MessageDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class RegisterThreeActivity extends BaseActivity implements
		OnClickListener {
	@ViewInject(id = R.id.top_text_name)
	TextView top_text_name;

	@ViewInject(id = R.id.top_text_step)
	TextView top_text_step;

	@ViewInject(id = R.id.btn_back, click = "btn_back")
	Button btn_back;

	@ViewInject(id = R.id.btn_ok, click = "btn_ok")
	Button btn_ok;

	private MessageDialog dialog;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.register_three);
		top_text_name.setText("填写注册信息");
		top_text_step.setText("3/5");
	}

	public void btn_back(View v) {
		this.finish();
	}

	public void btn_ok(View v) {
		dialog = new MessageDialog(this, "提示", "选择性别后可以选择完成注册或者进入完善资料","完成注册","完善资料", true,
				true, this);
		dialog.show();
	}

	@Override
	public void onClick(View v) {
		Intent intent= new Intent();
		switch (v.getId()) {
		case R.id.dialog_generic_btn_button1:
			dialog.dismiss();
			intent.setClass(this,HomePageActivity.class);
			startActivity(intent);
			break;
		case R.id.dialog_generic_btn_button2:
			intent.setClass(this,VerifyActivity.class);
			intent.putExtra("type", 1);
			startActivity(intent);
           dialog.dismiss();
			break;

		default:
			break;
		}

	}

}
